/* ---------------------------------Marlin Toolkit-----------------------------*
Authors : Daniel Randle, Alex Bourne
Date Created : Feb 20 2013

File:
	debugwindow.h

Description:
	This file contains the declaration for the debugdisplay class along with any
	helper functions associated with the class
*-----------------------------------------------------------------------------*/

#ifndef DEBUGWINDOW_H
#define DEBUGWINDOW_H

// Inlcudes
#include <qtextedit.h>// could forward declare but I need QWidget so might
						 // as well inlcude in header

// Class Forward Declarations
class QVBoxLayout;
class QToolBar;
class QAction;

/*------------------------------Class DebugDisplay-----------------------------*
Namespace : ToolkitGui

Description:
	This class derives from QWidget - it contains a QTextEdit for displaying
	read only debug text. It supports writing text and clearing the screen.
	Each print command will end with a new line. Other than that pretty simple
	class.
*-----------------------------------------------------------------------------*/
namespace ToolkitGui
{
	class DebugWindow : public QWidget
	{
		Q_OBJECT // Qt macro for enabling signals and slots

	public:
		// Ctor
		DebugWindow(QWidget * parent);

		// Dtor
		~DebugWindow();

		// Interface
		void writeToScreen(const QString & text);
		void clearScreen();

	private slots:
		void onClearScreen();
		void onSelectAll();
		void onCopy();

	private:
		// setup
		void _setupWidgets();
		void _setupConnections();

		QTextEdit * screen;
		QToolBar * topToolBar;
		QAction * clrScreen;
		QAction * selectAll;
		QAction * copy;

	};
}
#endif // DEBUGDISPLAY_H